import React from "react"
import {NavLink} from "react-router-dom"
import $ from "jquery"

import "./../scss/product.scss";
class productHeader extends React.Component {
	constructor(props){
		super(props);
		this.tap = this.tap.bind(this);
	}
	tap(){
		window.history.go(-1);
	}
	componentDidMount(){
//		console.log(location.href.split(':')[2].split('/')[3])
		var brandId = location.href.split(':')[2].split('/')[3];
		var title2 = document.getElementById("title2");
		$.ajax({
			type:"get",
			url:"http://w.lefeng.com/api/neptune/brand/details/v1?brandId="+brandId,
			success:function(data){
				
				$(title2).html(data.data.name);
			}
		});
	}
	render() {
		return (
			<div id="detailHeader">
				<b className="iconfont icon-fanhui" onClick={this.tap}></b>
				<h3 id="title2"></h3>
				<NavLink to="/home"><i className="iconfont icon-zhuye"></i></NavLink>
			</div>
		)
	}

}

export default productHeader;

